import wxRequest from '../utils/wxRequest'
import appConfig from '../utils/appConfig'

// 设置api的请求路径
wxRequest.baseUrl = `${appConfig.HTTP_BAST_URL}api/public/v1/`
// 请求轮播图数据
const getHomeSwiper = params => wxRequest('home/swiperdata', params).then(res => res.data)
// 请求导航数据
const getHomeNav = params => wxRequest('home/catitems', params).then(res => res.data)
// 请求首页楼层数据
const getHomeFloor = params => wxRequest('home/floordata', params).then(res => res.data)
// 请求商品详情数据
const getGoodsDetail = params => wxRequest('goods/detail', params).then(res => res.data)
// 用户登陆换取token
const getUserToken = params => wxRequest('users/wxlogin', params).then(res => res.data)
export default {
  getHomeSwiper,
  getHomeNav,
  getHomeFloor,
  getGoodsDetail,
  getUserToken
}
